//
//  PublishTopTableViewCell.m
//  CarTown
//
//  Created by xionghao on 15/8/10.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "PublishTopTableViewCell.h"
#import "Pubmode.h"
@implementation PublishTopTableViewCell
+(instancetype)cellWithTableView:(UITableView *)tableview{
    
    static NSString *ID=@"top";
    
    PublishTopTableViewCell *cell=[tableview dequeueReusableCellWithIdentifier:ID];
    if (cell==nil) {
        [tableview registerNib:[UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil] forCellReuseIdentifier:ID];
        cell=[tableview dequeueReusableCellWithIdentifier:ID];
    }
    return cell;
}
- (void)awakeFromNib {
    // Initialization code
}
-(void)setMode:(Pubmode *)mode{
    _mode=mode;
    self.titlelable.text=_mode.name;
    self.startlable.hidden=!_mode.isMust;
    self.detail.text=_mode.detail?_mode.detail:@"请选择";
    if (_mode.isNeedHideA) {
        self.rightmargin.constant=16;
    }else{
        self.rightmargin.constant=0;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
